/**
 * ReportGear(2011)
 */
package com.reportgear.designer.applet;

import java.awt.BorderLayout;

import javax.swing.JApplet;
import javax.swing.UIManager;

import netscape.javascript.JSObject;

import com.reportgear.designer.DesignerPane;
import com.reportgear.designer.view.menu.DesignerMenu;
import com.reportgear.report.setting.AppletSettings;
import com.reportgear.report.setting.ApplicationContext;
import com.reportgear.swing.util.GuiUtils;

/**
 * 设计器Applet
 * 
 * @version 1.0 2011-6-26
 * @author <a herf="lexloo@gmail.com">lexloo</a>
 * @since Report 1.0
 */
public class DesignerApplet extends JApplet {
	/**
	 * UID
	 */
	private static final long serialVersionUID = 5159236997361828933L;

	public void init() {
		ApplicationContext.INSTANCE.setApplet(true);
		AppletSettings appletSettings = AppletSettings.INSTANCE;

		appletSettings.setJsObject(JSObject.getWindow(this));

		initComponents();
	}

	public void start() {
	}

	public void stop() {
	}

	public void destroy() {
	}

	private void initComponents() {
		try {
			UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
		} catch (Exception e) {
			e.printStackTrace();
		}

		GuiUtils.setDefaultUIFont("宋体");

		this.setLayout(new BorderLayout());
		this.add(new DesignerPane(), BorderLayout.CENTER);
		this.setJMenuBar(new DesignerMenu());
	}
}
